package com.qc.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.qc.dao.MerchantDao;
import com.qc.entity.MerchantEntity;
import com.qc.entity.search.MerchantSearchEntity;
import com.qc.service.MerchantService;

@Service("merchantService")
public class MerchantServiceImpl implements MerchantService{

    @Resource(name="merchantDao")
    private MerchantDao merchantDao;
    
    @Override
    public int register(MerchantEntity merchantEntity) {

        return merchantDao.register(merchantEntity);
    }

    @Override
    public MerchantEntity loginMerchant(String userName, String password) {

        return merchantDao.loginMerchant(userName, password);
    }

    @Override
    public int saveMerchant(MerchantEntity merchantEntity) {

        return merchantDao.saveMerchant(merchantEntity);
    }

    @Override
    public MerchantEntity getMerchantId(long id) {
        
        return merchantDao.getMerchantId(id);
    }

    @Override
    public MerchantEntity getMerchantUserName(String userName) {

        return merchantDao.getMerchantUserName(userName);
    }
    
    /*@Override
	public int getListMerchantCount(long shopType,long shopTypeTwo) {

    	return merchantDao.getListMerchantCount(shopType,shopTypeTwo);
	}*/


	@Override
	public List<MerchantEntity> getAllMerchant(MerchantSearchEntity merchantSearchEntity,int pageNo, int pageSize) {

		return merchantDao.getAllMerchant(merchantSearchEntity,pageNo, pageSize);
	}

	@Override
	public void updateFollowNumber(long shopId) {
		
		merchantDao.updateFollowNumber(shopId);
	}

	@Override
	public void updateBrowseNumber(long shopId) {

		merchantDao.updateBrowseNumber(shopId);
	}

	@Override
	public void updateFollowNumberCancel(long shopId) {

		merchantDao.updateFollowNumberCancel(shopId);
	}

	@Override
	public int updateIsAuth(long id, int isAuth,String refuse) {

		return merchantDao.updateIsAuth(id, isAuth,refuse);
	}

	@Override
	public int getWebListMerchantCount(int isAuth, String shopName) {
		
		return merchantDao.getWebListMerchantCount(isAuth, shopName);
	}

	@Override
	public List<MerchantEntity> getWebAllMerchant(int isAuth, String shopName, int pageNo, int pageSize) {

		return merchantDao.getWebAllMerchant(isAuth, shopName, pageNo, pageSize);
	}

	@Override
	public int deleteMerchantId(long shopId) {

		return merchantDao.deleteMerchantId(shopId);
	}

	@Override
	public MerchantEntity getMerchantShopId(long shopId) {

		return merchantDao.getMerchantShopId(shopId);
	}


	
}
